<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
        "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">     
<head>      
    <meta http-equiv="content-type" content="text/html; charset=utf-8"/>
    <title>易卡会存款管理</title>
    <link rel="icon" href="favicon.ico" type="image/x-icon"/>    
    <#include "../template/include/assign.ftl">
	<#include "../template/include/source.ftl">
	<#include "../template/template_listPage.ftl">    
    <link href="${web_static}/admin/css/list.css" rel="stylesheet" type="text/css"/>
    <style type="text/css">
        .page {
            float: right;
            padding-top: 15px;
            margin-right: 15px;
        }
    </style>   
    <script type="text/javascript">    
     </script>   
</head>    
<body class="list"> 
     <div class="body">
     	<div class="listBar">
       		<h1><span class="icon">&nbsp;</span>资金平衡&nbsp;<span class="pageInfo"></span></h1>
    	</div>
    	
    	
    	<@pageList page=(page!) id="listForm" action="${web_base}/ekhui/fund_balance!list.htm" query="fundBalanceQuery" isEmpty=true>
    		<div class="operateBar">

			        <label>查找：</label>
			        商户名称：<input type="text" name="fundBalance.traderName" value="${fundBalance.traderName!''}"/>
			    </select>    
			                   开始日期：
				  	<input type="text" class="Wdate" id="startTime" name="startTime"
				onfocus="WdatePicker({skin:'whyGreen',dateFmt:'yyyy-MM-dd'})" 
				value="${startTime!''}"
				/>
				
				  	结束日期：
				  	<input type="text" class="Wdate" id="endTime" name="endTime"
				onfocus="WdatePicker({skin:'whyGreen',dateFmt:'yyyy-MM-dd'})" 
				value="${endTime!''}"
				/>        
			        <input type="submit" id="searchButton" class="searchButton" value=""/>
			  	 	
    		</div>
    		<table class="listTable">
    			<tr>
		            <th>
		                <span class="sort" name="oid_goodsitem">账务日期</span>
		            </th>
		            <th>
		                <span class="sort" name="name_goods">商户名称</span>
		            </th>
		            <th>
		                <span class="sort" name="oid_biz">账户名称</span>
		            </th>
		            <th style="text-align:right;">
		                <span class="sort" name="sup_price">存款总额(元)</span>
		            </th>
		            <th style="text-align:right;">
		                <span class="sort" name="price">支付总额(元)</span>
		            </th>
		            
		            <th style="text-align:right;">
		                <span class="sort" name="oid_biz">退款总额(元)</span>
		            </th>
		            <th style="text-align:right;">
		                <span class="sort" name="sup_price">期初余额(元)</span>
		            </th>
		            <th style="text-align:right;">
		                <span class="sort" name="price">期末余额(元)</span>
		            </th>
		            <th>
		                <span class="sort" name="price">平衡</span>
		            </th>
		          	<th>
		                <span class="sort" name="price">生成时间</span>
		            </th>
       		   </tr>
    		   <#if page?? && page.list?? && (page.list?size gt 0)>
    			  <#list page.list as fundBalance>
    			  	
    			  		<#if fundBalance.totalDepositMoney??>
    			  			<#assign totalDepositMoney = fundBalance.totalDepositMoney/1000 /> 
    			  		<#else>
    			  			<#assign totalDepositMoney = 0/>
    			  		</#if>
    			  	
    			  	
    			  		<#if fundBalance.totalPayMoney??>
    			  			<#assign totalPayMoney=fundBalance.totalPayMoney/1000 />
    			  		<#else>
    			  			<#assign totalPayMoney=0 />
    			  		</#if>
    			  	
    			  		<#if fundBalance.totalRefundMoney??>
    			  			<#assign totalRefundMoney=fundBalance.totalRefundMoney/1000 />
    			  		<#else>
    			  			<#assign totalRefundMoney=0/>
    			  		</#if>
    			  	
    			  	
    			  		<#if fundBalance.startBalance??>
    			  			<#assign startBalance=fundBalance.startBalance/1000 />
    			  		<#else>
    			  			<#assign startBalance=0/>
    			  		</#if>
    			  	
    			  	
    			  		<#if fundBalance.endBalance??>
    			  			<#assign endBalance=fundBalance.endBalance/1000 />
    			  		<#else>
    			  			<#assign endBalance=0 />
    			  		</#if>
    			  	
    				 <tr>
    					 <td>
                   		   ${fundBalance.accountDay?string('yyyy-MM-dd')}
                   		 </td>
    					 <td>
	                        ${fundBalance.traderName!''}
                  		</td>
                   		<td>
		                    ${fundBalance.accountName!''}
		                </td>
		                <td style="text-align:right;">
		                	
						   	 ${totalDepositMoney?string('0.000')}
		                </td>
		                <td style="text-align:right;">
		                   	 ${totalPayMoney?string('0.000')}
                       </td>
                       <td style="text-align:right;">
                       ${totalRefundMoney?string('0.000')}
                       </td>
					   <td style="text-align:right;">
					   	${startBalance?string('0.000')}
					   </td>
					    <td style="text-align:right;">
					   	${endBalance?string('0.000')}
					   </td>
					   <td>
					   	<#if totalDepositMoney?number + totalRefundMoney?number + startBalance?number - totalPayMoney?number == endBalance?number>
					   		平衡
					   	
					   	</#if>
					   </td>
					   <td>
                   		   ${fundBalance.createTime?string('yyyy-MM-dd HH:mm:ss')}
                   		 </td>
    				 </tr>
    		      </#list>
    		   </#if>
    		</table>
	    	<#if page?? && page.list?? && (page.list?size <= 0)>
		        <div class="noRecord">
		         	   没有找到任何记录!
		        </div>
   			</#if>
     	</@pageList>
     </div>
</body>
</html>   
  